#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "Administrator"
__name__="user"
__date__="2016/7/7"
__time__="10:07"
"""
from utility.sql_helper import mysql_helper
class User(object):
    def __init__(self):
        self.__helper = mysql_helper()
    def Check_login(self,username,passwd):
        sql = "select * from user where name=%s and password =%s"
        parms = (username,passwd)
        return  self.__helper.get_one(sql,parms)
    def get_id(self,username):
        self.__helper=mysql_helper()
        sql= "select id from user where name=%s"
        parms=(username,)
        return self.__helper.get_one(sql,parms)
